package com.mz.mattress.client.api.biz;

import com.mz.mattress.api.common.Result;
import com.mz.mattress.client.service.MattressMsgService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/mattress")
public class MattressController {

    @Autowired
    private MattressMsgService mattressMsgService;

    @GetMapping("/test")
    public Result test() {
        return Result.ok();
    }

    @PostMapping("/callback")
    public Result callback(@RequestBody String message) {
//        log.info("mattress_callback=" + message);
        mattressMsgService.process(message);
        return Result.ok();
    }

}